var InfoApi = require('../../../api/information.js');

Page({
  data: {
    detailModel: {},
    currentNewsId: null
  },

  onLoad(options) {},

  onReady() {

  },

  onShow() {
    let _newsInfo = wx.getStorageSync('newsInfo');
    console.log(_newsInfo);
    wx.setNavigationBarTitle({ title: _newsInfo.newsTitle })
    this.getFrontNews(_newsInfo.newsId)
  },

  onHide() {},

  // 查询前端新闻详情
  getFrontNews(_newsId){
    InfoApi.getFrontNews({newsId: _newsId}).then(res=>{
      if (res.retCode == '000000' && res.errCode == '000000') {
        this.setData({
          detailModel: res.data
        })
      }
    })
  },

  onUnload() {},

  onPullDownRefresh() {

  },

  onReachBottom() {

  },

  onShareAppMessage() {

  }
})